-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ProcessScheduler
#729
Conversation
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
…test.py Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
ShiftableLoadScheduler
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!!
I have yet to review the intelligent part, but I already have some comments about the modeling and documentation.
Also, I believe this scheduler deserves a dedicated CLI command.
And I believe we should add one simple integration test in api/v3_0/tests/test_sensor_schedules.py
, to see that this scheduler can be used via the API, with the job queue involved.
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In services.scheduling.find_scheduler_class
we should look up this class if the asset type is LoadType
.
Then, this scheduler doesn't require custom configuration of scheduling like you did in #768:
{"custom-scheduler": {"class": "ShiftableLoadScheduler", "module": "flexmeasures.data.models.planning.shiftable_load"}
This should be one of our batteries-included schedulers which just works.
Just a note on this: While we should do what I said above in this PR, the real solution should be that Asset Types can specify what scheduler class should be used for them. That should be its own PR, probably. I might start a discussion, as I don't know what I really meant with "logic store" in the code comment, and looking up logic/algorithms might get a new representation after our work on reporters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do have some wishes here but this looks close to ready to me!
Good point! In the context of |
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving forward, thanks!
See also my inline comment about doing the feasibility check in another way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some mentions of consumption-price-sensor which we can do without, or whoch shluld be moved.
… only when optimizing a INFLEXIBLE or SHIFTABLE load type. Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
ShiftableLoadScheduler
ProcessScheduler
Just as an addendum from our conversation today: Multiple schedulers per asset is not the standard use case. It's an edge case. I'm careful with starting modeling sketches with the edge case, as it's confusing for users/developers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually have one more renaming request (if you agree), sorry :)
Otherwise this is it IMO
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
…' into feature/shiftable-load-scheduler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve, with one more tiny wish!
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Description
Following the code in E-mission, this PR introduces a new scheduler that can schedule flexible loads. The
ProcessScheduler
implements the logic to schedule three different types of loads. Optionally, the user can specify a series of time restrictions (defined as a start and duration pair) where the load cannot be schedule to, in other words, the load cannot be ON during the course of any the time restriction.This class handles three type of loads:
Tests
This PR includes tests for the following features:
ProcessSchedulerModelSchema
in flexmeasures/data/models/planning/tests/test_shiftable_load.pyProcessScheduler
in flexmeasures/data/models/planning/tests/test_shiftable_load.py